package com.wc.blue_bridge_test.base.T64;

import java.util.HashMap;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/12/28 0:34
 * @description 芯片测试
 * https://lx.lanqiao.cn/problem.page?gpid=T64
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        // 正确的芯片一行都相同，所以很，因为是大于一半的，所以我们其实是可以排序取中间值
        HashMap<String, Integer> map = new HashMap<>();
        int len = 0;
        String lenS = "";
        for (int i = 0; i < n; i++) {
            String s = sc.nextLine();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
            int curLen = map.get(s);
            if (curLen > len) {
                len = curLen;
                lenS = s;
            }
        }
        len = lenS.length();
        StringBuffer ans = new StringBuffer();
        for (int i = 0; i < len; i += 2) {
            char c = lenS.charAt(i);
            if (c == '1') {
                ans.append(' ');
                ans.append(i / 2 + 1);
            }
        }
        ans.replace(0, 1, "");
        System.out.println(ans);
    }
}
